home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ für Kids
/
C++ for kids.iso
/
SETUP
/
US
/
CBUILDER
/
DATA.Z
/
COMMDLG.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-02-13
|
25KB
|
692 lines
{*******************************************************}
{ }
{ Delphi Run-time Library }
{ Windows 32bit API Interface Unit }
{ }
{ Copyright (c) 1995,96 Borland International }
{ }
{*******************************************************}
unit CommDlg;
interface
uses Windows, Messages;
type
POpenFilenameA = ^TOpenFilenameA;
POpenFilenameW = ^TOpenFilenameW;
POpenFilename = POpenFilenameA;
tagOFNA = packed record
lStructSize: DWORD;
hWndOwner: HWND;
hInstance: HINST;
lpstrFilter: PAnsiChar;
lpstrCustomFilter: PAnsiChar;
nMaxCustFilter: DWORD;
nFilterIndex: DWORD;
lpstrFile: PAnsiChar;
nMaxFile: DWORD;
lpstrFileTitle: PAnsiChar;
nMaxFileTitle: DWORD;
lpstrInitialDir: PAnsiChar;
lpstrTitle: PAnsiChar;
Flags: DWORD;
nFileOffset: Word;
nFileExtension: Word;
lpstrDefExt: PAnsiChar;
lCustData: LPARAM;
lpfnHook: function(Wnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
lpTemplateName: PAnsiChar;
end;
{$nonamespace tagOFNA}
TOpenFilenameA = tagOFNA;
tagOFNW = packed record
lStructSize: DWORD;
hWndOwner: HWND;
hInstance: HINST;
lpstrFilter: PWideChar;
lpstrCustomFilter: PWideChar;
nMaxCustFilter: DWORD;
nFilterIndex: DWORD;
lpstrFile: PWideChar;
nMaxFile: DWORD;
lpstrFileTitle: PWideChar;
nMaxFileTitle: DWORD;
lpstrInitialDir: PWideChar;
lpstrTitle: PWideChar;
Flags: DWORD;
nFileOffset: Word;
nFileExtension: Word;
lpstrDefExt: PWideChar;
lCustData: LPARAM;
lpfnHook: function(Wnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
lpTemplateName: PWideChar;
end;
{$nonamespace tagOFNW}
TOpenFilenameW = tagOFNW;
TOpenFilename = TOpenFilenameA;
function GetOpenFileNameA(var OpenFile: TOpenFilenameA): Bool; stdcall;
function GetOpenFileNameW(var OpenFile: TOpenFilenameW): Bool; stdcall;
function GetOpenFileName(var OpenFile: TOpenFilename): Bool; stdcall;
function GetSaveFileNameA(var OpenFile: TOpenFilenameA): Bool; stdcall;
function GetSaveFileNameW(var OpenFile: TOpenFilenameW): Bool; stdcall;
function GetSaveFileName(var OpenFile: TOpenFilename): Bool; stdcall;
function GetFileTitleA(FileName: PAnsiChar; Title: PAnsiChar; TitleSize: Word): Smallint; stdcall;
function GetFileTitleW(FileName: PWideChar; Title: PWideChar; TitleSize: Word): Smallint; stdcall;
function GetFileTitle(FileName: PChar; Title: PChar; TitleSize: Word): Smallint; stdcall;
const
OFN_READONLY = $00000001;
OFN_OVERWRITEPROMPT = $00000002;
OFN_HIDEREADONLY = $00000004;
OFN_NOCHANGEDIR = $00000008;
OFN_SHOWHELP = $00000010;
OFN_ENABLEHOOK = $00000020;
OFN_ENABLETEMPLATE = $00000040;
OFN_ENABLETEMPLATEHANDLE = $00000080;
OFN_NOVALIDATE = $00000100;
OFN_ALLOWMULTISELECT = $00000200;
OFN_EXTENSIONDIFFERENT = $00000400;
OFN_PATHMUSTEXIST = $00000800;
OFN_FILEMUSTEXIST = $00001000;
OFN_CREATEPROMPT = $00002000;
OFN_SHAREAWARE = $00004000;
OFN_NOREADONLYRETURN = $00008000;
OFN_NOTESTFILECREATE = $00010000;
OFN_NONETWORKBUTTON = $00020000;
OFN_NOLONGNAMES = $00040000;
OFN_EXPLORER = $00080000;
OFN_NODEREFERENCELINKS = $00100000;
OFN_LONGNAMES = $00200000;
{ Return values for the registered message sent to the hook function
when a sharing violation occurs. OFN_SHAREFALLTHROUGH allows the
filename to be accepted, OFN_SHARENOWARN rejects the name but puts
up no warning (returned when the app has already put up a warning
message), and OFN_SHAREWARN puts up the default warning message
for sharing violations.
Note: Undefined return values map to OFN_SHAREWARN, but are
reserved for future use. }
OFN_SHAREFALLTHROUGH = 2;
OFN_SHARENOWARN = 1;
OFN_SHAREWARN = 0;
type
POFNotifyA = ^TOFNotifyA;
POFNotifyW = ^TOFNotifyW;
POFNotify = POFNotifyA;
_OFNOTIFYA = packed record
hdr: TNMHdr;
lpOFN: POpenFilenameA;
pszFile: PAnsiChar;
end;
{$nonamespace _OFNOTIFYA}
TOFNotifyA = _OFNOTIFYA;
_OFNOTIFYW = packed record
hdr: TNMHdr;
lpOFN: POpenFilenameW;
pszFile: PWideChar;
end;
{$nonamespace _OFNOTIFYW}
TOFNotifyW = _OFNOTIFYW;
TOFNotify = TOFNotifyA;
const
CDN_FIRST = -601;
CDN_LAST = -699;
{ Notifications when Open or Save dialog status changes }
CDN_INITDONE = CDN_FIRST - 0;
CDN_SELCHANGE = CDN_FIRST - 1;
CDN_FOLDERCHANGE = CDN_FIRST - 2;
CDN_SHAREVIOLATION = CDN_FIRST - 3;
CDN_HELP = CDN_FIRST - 4;
CDN_FILEOK = CDN_FIRST - 5;
CDN_TYPECHANGE = CDN_FIRST - 6;
CDM_FIRST = WM_USER + 100;
CDM_LAST = WM_USER + 200;
{ Messages to query information from the Open or Save dialogs }
{ lParam = pointer to text buffer that gets filled in
wParam = max number of characters of the text buffer (including NULL)
return = < 0 if error; number of characters needed (including NULL) }
CDM_GETSPEC = CDM_FIRST + 0;
{ lParam = pointer to text buffer that gets filled in
wParam = max number of characters of the text buffer (including NULL)
return = < 0 if error; number of characters needed (including NULL) }
CDM_GETFILEPATH = CDM_FIRST + 1;
{ lParam = pointer to text buffer that gets filled in
wParam = max number of characters of the text buffer (including NULL)
return = < 0 if error; number of characters needed (including NULL) }
CDM_GETFOLDERPATH = CDM_FIRST + 2;
{ lParam = pointer to ITEMIDLIST buffer that gets filled in
wParam = size of the ITEMIDLIST buffer
return = < 0 if error; length of buffer needed }
CDM_GETFOLDERIDLIST = CDM_FIRST + 3;
{ lParam = pointer to a string
wParam = ID of control to change
return = not used }
CDM_SETCONTROLTEXT = CDM_FIRST + 4;
{ lParam = not used
wParam = ID of control to change
return = not used }
CDM_HIDECONTROL = CDM_FIRST + 5;
{ lParam = pointer to default extension (no dot)
wParam = not used
return = not used }
CDM_SETDEFEXT = CDM_FIRST + 6;
type
PChooseColorA = ^TChooseColorA;
PChooseColorW = ^TChooseColorW;
PChooseColor = PChooseColorA;
tagCHOOSECOLORA = packed record
lStructSize: DWORD;
hWndOwner: HWND;
hInstance: HWND;
rgbResult: COLORREF;
lpCustColors: ^COLORREF;
Flags: DWORD;
lCustData: LPARAM;
lpfnHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
lpTemplateName: PAnsiChar;
end;
{$nonamespace tagCHOOSECOLORA}
TChooseColorA = tagCHOOSECOLORA;
tagCHOOSECOLORW = packed record
lStructSize: DWORD;
hWndOwner: HWND;
hInstance: HWND;
rgbResult: COLORREF;
lpCustColors: ^COLORREF;
Flags: DWORD;
lCustData: LPARAM;
lpfnHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
lpTemplateName: PWideChar;
end;
{$nonamespace tagCHOOSECOLORW}
TChooseColorW = tagCHOOSECOLORW;
TChooseColor = TChooseColorA;
function ChooseColorA(var CC: TChooseColorA): Bool; stdcall;
function ChooseColorW(var CC: TChooseColorW): Bool; stdcall;
function ChooseColor(var CC: TChooseColor): Bool; stdcall;
const
CC_RGBINIT = $00000001;
CC_FULLOPEN = $00000002;
CC_PREVENTFULLOPEN = $00000004;
CC_SHOWHELP = $00000008;
CC_ENABLEHOOK = $00000010;
CC_ENABLETEMPLATE = $00000020;
CC_ENABLETEMPLATEHANDLE = $00000040;
CC_SOLIDCOLOR = $00000080;
CC_ANYCOLOR = $00000100;
type
PFindReplaceA = ^TFindReplaceA;
PFindReplaceW = ^TFindReplaceW;
PFindReplace = PFindReplaceA;
tagFINDREPLACEA = packed record
lStructSize: DWORD; { size of this struct $20 }
hWndOwner: HWND; { handle to owner's window }
hInstance: HINST; { instance handle of.EXE that
contains cust. dlg. template }
Flags: D